:root {
  --primary-color: #8a2be2;
  --primary-hover-color: #9d4edd;
  --secondary-color: #ff6b6b;
  --background-color: #f8f9fa;
  --form-bg-color: rgba(255, 255, 255, 0.98);
  --text-color: #2d3748;
  --border-color: #e9d8fd;
  --error-color: #ff4757;
  --success-color: #1dd1a1;
  --glow-color: rgba(138, 43, 226, 0.3);
  --transition-speed: 0.3s;
}

/* 统一所有表单容器的居中样式 */
.form-container {
  background: var(--form-bg-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 
    0 15px 40px -10px rgba(0, 0, 0, 0.15),
    0 10px 25px -15px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  width: 100%;
  max-width: 500px; /* 缩小宽度 */
  margin: 0 auto; /* 确保居中 */
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f3e8ff 0%, #f8f9fa 100%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-color);
  position: relative;
  /* 移除 overflow: hidden，允许页面滚动 */
  padding: 1rem; /* 添加内边距防止在小屏幕上溢出 */
}

body::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%);
  animation: rotate 25s linear infinite;
  z-index: -1;
}

/* 调整注册表单的行间距 */
.form-row {
  display: flex;
  gap: 1rem; /* 缩小间距 */
  margin-bottom: 1rem;
}

.form-group {
  flex: 1;
  position: relative;
}

h2 {
  font-size: 1.75rem; /* 稍微缩小标题 */
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.75rem;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(138, 43, 226, 0.2);
}

h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(138, 43, 226, 0.2);
}

/* 调整输入框大小 */
input {
  width: 90%;
  padding: 0.875rem; /* 稍微缩小内边距 */
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9375rem;
  transition: all var(--transition-speed) ease;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 
    inset 0 1px 3px rgba(0, 0, 0, 0.05),
    0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 调整按钮大小 */
button {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 1.25rem;
  border: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  box-shadow: 
    0 5px 15px rgba(138, 43, 226, 0.3),
    0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  margin-top: 1.5rem;
  letter-spacing: 0.5px;
}

button::after {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(30deg);
  transition: all 0.7s ease;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 8px 25px rgba(138, 43, 226, 0.4),
    0 5px 10px rgba(0, 0, 0, 0.1);
}

button:hover::after {
  left: 100%;
}

.link {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  position: relative;
  display: inline-block;
}

.link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  transition: width var(--transition-speed) ease;
}

.link:hover {
  color: var(--primary-hover-color);
}

.link:hover::after {
  width: 100%;
}

/* 调整错误和成功消息的样式 */
.error, .success {
  font-size: 0.875rem;
  margin: 0.875rem 0;
  padding: 0.75rem;
}

/* 响应式调整 - 在小屏幕上改为单列布局 */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .form-container {
    padding: 2rem 1.5rem;
    max-width: 90%;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
}